package com.shuogesha.platform.client;

import java.util.List;
import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.shuogesha.common.util.JsonResult;
import com.shuogesha.platform.entity.Menu;
import com.shuogesha.platform.entity.Role;

@FeignClient(value = "cloudFast-platform-role")
public interface RoleFeignClient {
	@RequestMapping(value = "/role/list")
	public Object list(@RequestParam("name") String name, @RequestParam("pageNo") Integer pageNo,
			@RequestParam("pageSize") Integer pageSize);

	@RequestMapping(value = "/role/get")
	public Object get(@RequestParam("id") Long id);

	@RequestMapping(value = "/role/save", method = RequestMethod.POST)
	public Object save(@RequestBody Role bean);

	@RequestMapping(value = "/role/update", method = RequestMethod.POST)
	public Object update(@RequestBody Role bean);

	@RequestMapping(value = "/role/delete")
	public Object delete(Long[] ids);
	
	
	// 
	@RequestMapping(value = "/role/saveRoleMenus", method = RequestMethod.POST)
	public JsonResult<Role> saveRoleMenus(@RequestBody Role bean);
	 
	@RequestMapping(value = "/role/getAllMenusByUser")
	public JsonResult<List<Menu>> getAllMenusByUser(@RequestParam("userId") Long userId, @RequestParam("type") Integer type);
	 
	@RequestMapping(value = "/role/getAllPermsByUser")
	public JsonResult<Set<String> > getAllPermsByUser(@RequestParam("userId") Long userId);
	
	@RequestMapping(value = "/role/getAllRole")
	public JsonResult<List<Role>> getAllRole();
}
